Skip to content

fix(rendering): Convert D3D8 ZBIAS integer values to D3D9 DEPTHBIAS floats - #5

Open
bobtista wants to merge 1 commit into
Ronnin2011:mainfrom
bobtista:bobtista/fix/depthbias-values
Open

fix(rendering): Convert D3D8 ZBIAS integer values to D3D9 DEPTHBIAS floats#5
bobtista wants to merge 1 commit into
Ronnin2011:mainfrom
bobtista:bobtista/fix/depthbias-values

Conversation

@bobtista

@bobtista bobtista commented Apr 9, 2026

Copy link
Copy Markdown

D3D8's D3DRS_ZBIAS accepted integer values 0-16. D3D9's D3DRS_DEPTHBIAS
accepts a float encoded as a DWORD. The existing #define mapping makes it
compile but the integer values (7, 8) become near-zero denormalized floats,
so depth bias is effectively always zero.

Adds Set_DX8_ZBias() which converts the legacy integer to a proper float
and updates all GeneralsMD call sites (decal mesh rendering, wireframe
overlay passes). The conversion factor may need visual tuning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant